package com.wthink.hzgj.data

import com.wthink.hzgj.data.domain.Line
import com.wthink.hzgj.data.domain.Station
import com.wthink.hzgj.util.Page
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.Flow


interface BusRepository {

    suspend fun refresh(): Job?

    suspend fun getStationList(line: String, updir: Boolean): List<Station>

    suspend fun findStationById(stationId: String, lineId: String? = null): Station?

    suspend fun findLineById(lineId: String): Line?

    suspend fun findLineNameById(lineId: String): String?

    suspend fun findLineIdByName(lineName: String): Long?

    suspend fun findStationNameById(stationId: String): String?

    suspend fun findStationIdByName(stationName: String): Long?

    suspend fun getLinePage(
        page: Int,
        onlyCache: Boolean,
        pageSize: Int = 28
    ): Page<com.wthink.hzgj.home.data.Line>

    fun page(
        list: List<Line>,
        page: Int,
        pageSize: Int = 28
    ): Page<com.wthink.hzgj.home.data.Line>

}